﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Ue.Framework.Data;
using Ue.Qcdz.Domain.Shops;
namespace Ue.Qcdz.Repositories.Shops
{
    public class ShopFactory : Ue.Infrastructure.EntityFactoryFramework.IEntityFactory<Shop>
    {

        internal class FieldNames : FieldNamesBase
        {
            public const string Name = "Name";
            public const string LogoUrl = "LogoUrl";
            public const string KeyWords = "KeyWords";
            public const string Description = "Description";
            public const string IsTop = "IsTop";
            public const string Remark = "Remark";
            public const string Status = "Status";
            public const string UserId = "UserId";
            public const string Banner = "Banner";

        }



        #region IEntityFactory<Shop> 成员
        public Shop BuildEntity(System.Data.IDataReader reader)
        {
            return new ShopFroxy(
                 reader.Get<Guid>(ShopFactory.FieldNames.EntityKey),
                 reader.Get<string>(ShopFactory.FieldNames.Name),
                 reader.Get<string>(ShopFactory.FieldNames.LogoUrl),
                 reader.Get<string>(ShopFactory.FieldNames.KeyWords),
                 reader.Get<string>(ShopFactory.FieldNames.Description),
                 reader.Get<int>(ShopFactory.FieldNames.IsTop),
                 reader.Get<string>(ShopFactory.FieldNames.Remark),
                 reader.Get<int>(ShopFactory.FieldNames.Status),
                 reader.Get<DateTime>(ShopFactory.FieldNames.CreateOn),
                 reader.Get<string>(ShopFactory.FieldNames.Banner)

            );
        }
        #endregion
    }
}
